package com.mlming.springboot.enums;

import lombok.Data;

// 一些响应状态的枚举
public enum ResponseEnum {
    ERROR(-1,"服务端异常"),
    SUCCESS(0,"成功"),
    USERNAME_OR_PASSWORD_ERROR(1,"用户名或密码错误"),
    USER_EXISTS(2,"用户已存在"),
    EMAIL_EXISTS(3,"邮箱已存在"),
    PARAMS_ERROR(4,"参数错误"),
    NEED_LOGIN(10,"用户未登陆,请先登录"),
    PRODUCT_OFF_SALE_OR_DELETE(11,"该商品已下架或删除"),
    PRODUCT_NOT_EXISTS(12,"该商品不存在"),
    PRODUCT_STOCK_NOT_ENOUGH(13,"该商品库存不足"),
    CART_NOT_EXISTS(14,"购物车不存在该商品"),
    SHIPPING_NOT_EXISTS(15,"收货地址不存在"),
    CART_NOT_SELECTED_PRODUCT(16,"购物车中没有商品被选择"),
    PRODUCT_IN_CART_NOT_EXISTS(17,"购物车中该商品并不存在"),
    ORDER_NOT_EXISTS(18,"订单不存在"),
    ORDER_STATUS_ERROR(19,"订单状态异常"),
    ;
    Integer code;
    String desc;

    ResponseEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
